s = input()

res = []

for c in s:  
    if res and res[-1] == c:  
        res.pop()
    else:  
        res.append(c)  
  
print(''.join(res))